import { computed } from 'vue'
import { mapMutations, useStore } from 'vuex'
 
export function useMutations(mapper) {
  // 拿到store独享
  const store = useStore()
 
  const MutationFns = mapMutations(mapper)
 
  // 对数据进行转换
  const newMutations  = {}
  Object.keys(MutationFns).forEach(key => {
      newMutations[key] = MutationFns[key].bind({ $store: store })
	})
 
  return newMutations
}